package com.bite.lesson3;

public class Demo {
    String name;
    public void eat() {
        System.out.println("吃饭......");
    }
    Demo(String name) {
        this.name = name;
    }
}
class A extends Demo {
    A(String name) {
        super(name);
    }

    @Override
    public void eat() {
        System.out.println(name + "吃个锤子......");
    }
    public void sleep() {
        System.out.println("睡大觉......");
    }

}
class Test {
    public static void main(String[] args) {
        Demo demo = new A("9999");
        demo.eat();
        if (demo instanceof A) {

        }

    }
}